<template>
    <div class="P-user">
        <!-- 用户信息：昵称、id、头像、卡号 -->
        <div class="card">
            <div class="mix">
                <div class="header"><img :src="user.head_pic" /></div>
                <div class="info">
                    <div>{{ user.nickname }}({{ user.id }})</div>
                    <div v-show="user.lv">等级：{{ user.lv }}</div>
                </div>
            </div>
            <div class="foot">{{ user.code }}</div>
        </div>
    </div>
</template>

<script>
export default {
    data: function () {
        return {
            user: {
                head_pic:
                    "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.hao661.com%2Fqq.hao661.com%2Fuploads%2Fallimg%2Fc140915%2F1410N00L0W60-52DO.gif&refer=http%3A%2F%2Fimg.hao661.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1650371880&t=87e597e822ed27db2e3c5aa3e84299e2",
            },
        };
    },
};
</script>

<style lang="less">
// less 的引入路径中带上 ~@ 就代表根目录了，aixy会自动解析的，有点坑啊，为什么没有和小程序统一标准？
@import "@/components/common/var.less";

.P-user {
    padding: 20px;
    .card {
        border-radius: 10px;
        background: @btnColor;
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        color: #fff;
        font-size: 28px;
        height: 300px;
        .mix {
            display: flex;
            align-items: center;
            .header {
                img {
                    @h: 120px;
                    display: block;
                    width: @h;
                    height: @h;
                    border-radius: 50%;
                }
            }
        }
        .foot {
            text-align: right;
        }
    }
}
</style>